package com.yixing.tech.wms.service;

import com.yixing.tech.common.base.BusinessException;
import org.bson.Document;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 库存服务
 *
 * @author yixing tech
 * @since 1.0.0
 */
public interface StockService {

    /**
     * 根据上架作业更新库存信息
     */
    boolean updateInStock(String upTaskCode) throws BusinessException;

    /**
     * 查询符合条件的容器，单个物料匹配容器
     */
    List<Document> queryMatchContainers(String containerType, List<String> areas, String materialCode, String batchNo, double capacity,
                                        Collection<String> excludeContainerCodes) throws BusinessException;

    /**
     * 查询符合条件的容器，多个物料混放匹配
     */
    List<Document> queryMatchMixedMaterialContainers(List<String> areas, List<String> materialCodes, String batchNo, Map<String, Double> capacityMapByMaterialCode,
                                        Collection<String> excludeContainerCodes) throws BusinessException;


    /**
     * 查询空容器
     */
    List<Document> queryEmptyContainers(String containerType, List<String> areas) throws BusinessException;


    /**
     * 查询符合条件的容器， 考虑 颜色与语种，暂未实现
     */
    List<Document> queryMatchContainers(String containerType, List<String> areas, String materialCode,
                                        String colorName, String languageName,
                                        String batchNo, double capacity) throws BusinessException;

    List<Document> queryStocks(String materialCode, List<String> areas, String locationCode, String batchNo);

    List<Document> statsLocationContainer();

}
